/**
 * @author liangxi
 * @since 2023/12/21
 */

#ifndef DESIGNPATTERN_PIZZASTOREFM_H
#define DESIGNPATTERN_PIZZASTOREFM_H

#include <memory>
#include "../Pizza/PizzaFM.h"

namespace Factory_FM {

    class PizzaStoreFM {
    public:
        virtual ~PizzaStoreFM() = default;

        std::shared_ptr<PizzaFM> orderPizza(const std::string &type) {
            std::shared_ptr<PizzaFM> pizza = createPizza(type);
            std::cout << "--- Making a " << pizza->getName() + " ---";
            pizza->prepare();
            pizza->bake();
            pizza->cut();
            pizza->box();
            return pizza;
        }

        virtual std::shared_ptr<PizzaFM> createPizza(const std::string &type) = 0;
    };

} // Factory_FM

#endif //DESIGNPATTERN_PIZZASTOREFM_H
